package com.doraro.coal.config.springconfig;

import com.doraro.coal.moudle.user.Interceptor.FirstLoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Created by Wuzhanghang on 2019/9/26 16:56
 */
@Configuration
public class WebConfigurer implements WebMvcConfigurer {
    @Autowired
    private FirstLoginInterceptor firstLoginInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(firstLoginInterceptor)
                .excludePathPatterns("/person","/changePwd","/static/**")
        ;
    }
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**")
                .addResourceLocations("classpath:/static/");
    }

}
